home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
plate.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
1KB
|
39 lines
-- camera state machine
beginStateMachine()
onMsg("buildMenu", function(msg)
-- build the pie menu
clearPieMenu();
local button;
button = addPieMenuButton("pm_washDishes", "washDishes");
button.addDescription(ACTIVITY, "washDishes");
button.addDescription(ACTIVITY, "improvePlateTidiness");
button.addIcon("guiIconWohnung");
end )
--
onMsg("washDishes", function(msg)
-- get character who initiated this action
local character = getStateObjectFromID(msg.sender);
-- get the walk state object
local wso = character.walkSO;
local wsoContext = StateMachineContext();
local dishwashers = character.getObjectsWithBehavior("dishwasher");
local dishwasher = dishwashers[1];
if (dishwasher) then
character.pushCommand("pm_washDishes", "washDishes", dishwasher, "");
character.popQueueEntry();
else
print("no dishwasher found");
instantAbort(character, EMOTICON_CANNOT, "emoThink")
end
end )
endStateMachine()